{*
    This Jet template block renders "Past day", "Latest", and "Next day buttons".
*}

{*
  Alternate version that uses Switcher as an import:
    {{ url := "/ranking?content=" + Content + "&mode=" + Mode + "&page=1" }}
    {{- path := slice("", "&date=" + .Data.PrevDate, "&date=" + .Data.NextDate) }}
    {{- name := slice("Latest", "Previous day", "Next day")}}
    {{- activeState := isset(Queries.date) ? Queries.date : "" }}
    {{- yield Switcher(baseURL=url, paths=path, names=name, activeState=activeState)}}
    {{ url := "/ranking?content=" + Content + "&mode=" + Mode + "&page=1" }}
*}

{{- block RankingNav() }}
  {{ url := "/ranking?content=" + Content + "&mode=" + Mode + "&page=1" }}
  {{- if .Data.PrevDate != "false" }}
  <a href="{{ url }}&date={{.Data.PrevDate}}" class="custom-btn-secondary me-2">
    <span>
      <i class="bi bi-arrow-left-circle-fill me-2"></i>Past
    </span>
  </a>
  {{- end }}
  <a href="{{ url }}" class="custom-btn-secondary me-2">
    <span>Latest</span>
  </a>
  <a href="{{ url }}&date={{.Data.NextDate}}" class="custom-btn-secondary{{ .Data.NextDate == "false" ? " disabled" : "" }}"{{ .Data.NextDate == "false" ? " aria-disabled=\"true\"" : "" }}>
    <span>
      Next<i class="bi bi-arrow-right-circle-fill ms-2"></i>
    </span>
  </a>
{{- end }}
